#!/usr/bin/env python
#-*- coding:utf-8 -*-

content = '*&^123abc0e'

def main_alpha(content):
    res = []
    for i in content:
        if 'a' <= i.lower() <= 'z':
            res.append(i)
    print(''.join(res))



def main(content):
    for tag in ('**', '0x'):
        if tag in content:
            print('输入有误')
            return
    if '+' in content:
        try:
            a=eval(content)
            if isinstance(a, complex):
                print(a*a)
            else:
                print('输入有误')
        except:
            print('输入有误')
    else:
        try:
            a=eval(content)
            print(a*a)
        except:
            print('输入有误')

if __name__ == '__main__':
    for content in ('1+2j',
                    'abc'):
        main(content)

